#!python

import random
from xlrd import open_workbook

def lineRead(filename):
    '''
    read one file by line
    '''

    fin = open(filename,'r',encoding='utf-8')
    seqs = fin.readlines()

    t=[]
    for i in seqs:
        t.append(i.strip())
    fin.close()
    
    return t

def ExcelRead(filename,sheetname="Sheet1"):
    '''
    read excel file
    '''
    wb = open_workbook(filename)
    sn=wb.sheet_names()
    sel=0
    for i in range(0,len(sn)):
        if sn[i]==sheetname:
            sel=i
            break
    values = []
    count=0
    for sheet in wb.sheets():
        if count==sel:
            number_of_rows = sheet.nrows
            number_of_columns = sheet.ncols
            for row in range(0, number_of_rows):
                t = []
                for col in range(number_of_columns):
                    val=sheet.cell(row,col).value
                    try:
                        t.append(val)
                    except ValueError:
                        pass
                values.append(t)
        count=count+1
    
    return values

people=[]

if True:
    people=lineRead("BI2021_QLNU.txt")
else:
    people0=ExcelRead("BI2021_QLNU.xlsx")
    for i in people0:
        people.append(i[1])



#print(people)
#random.shuffle(people)
#print(people)

##select three people randomly
number=3
print(random.choices(people,k=number))
